package com.gitee.dufafei.plugin.variable;

import java.util.Map;

public interface VariableSpace {

    /**
     * Initialize the variable space with the default values
     */
    void initializeVariablesFrom(VariableSpace parent);

    /**
     * Copy a variable from another space
     */
    void copyVariablesFrom(VariableSpace space);

    /**
     * Injecting variable
     */
    void injectVariables(Map<String, String> prop);

    /**
     * Share a variable space
     */
    void shareVariablesWith(VariableSpace space);

    /**
     * Gets the parent element of the variable space.
     */
    VariableSpace getParentVariableSpace();

    /**
     * Sets the parent element of the variable space
     */
    void setParentVariableSpace(VariableSpace parent);

    String getVariable(String variableName, String defaultValue);

    String getVariable(String variableName);

    void setVariable(String variableName, String variableValue);

    boolean getBooleanValue(String variableName, boolean defaultValue);

    /**
     * Replace environment variables
     */
    String environmentSubstitute(String aString);

    /**
     * Get all variable names
     */
    String[] listVariables();
}
